package com.chenglai.seckill.feign;

import com.chenglai.commonutils.common.Result;
import com.chenglai.commonutils.common.StatusCode;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * 类描述：
 *
 * @Author rxh
 * @Date 2023/11/28 15:12
 */
@Component
public class PayFallback implements FallbackFactory<PayService> {
    @Override
    public PayService create(Throwable cause) {
        return new PayService() {
            @Override
            public Result refund(String transactionId, Integer shopId, Double totalNum, Double refundFee, String refundDesc) {
                return new Result(false, StatusCode.ERROR, "服务异常");
            }
        };
    }
}
